import { fetch } from './fetch'
// //订单续保
// export const renewalOrder = (isuAid, skuAid, prodAid, isuDtStart, coupons) => fetch('POST', '/order/au/renewalOrder', {
//     isuAid: isuAid,
//     skuAid: skuAid,
//     prodAid: prodAid,
//     isuDtStart: isuDtStart,
//     coupons: coupons
// });




/**
 * 课程分类管理
 * by Jehu
*/
// 获取课程分类列表
export const obtainCourseTypeList = (page) => fetch('POST', '/weapp/getType', {
    page
});
// 添加课程分类
export const appendCourseType = (type_name, total_day, type_price, type_describe, type_gratis, type_banner, certificate, type_referral, type_lesson) => fetch('POST', '/weapp/addType', {
    type_name,
    total_day,
    type_price,
    type_describe,
    type_gratis,
    type_banner,
    certificate,
    type_referral,
    type_lesson
});
// 编辑课程分类
export const compileCourseType = (type_id, type_name, total_day, type_price, type_describe, type_gratis, type_banner, certificate, type_referral, type_lesson) => fetch('POST', '/weapp/editType', {
    type_id,
    type_name,
    total_day,
    type_price,
    type_describe,
    type_gratis,
    type_banner,
    certificate,
    type_referral,
    type_lesson 
});
// 推荐课程分类
export const recommendCourseType = (type_id, type_recommend) => fetch('POST', '/weapp/recommendType', {
    type_id, 
    type_recommend
});
// 删除课程分类
export const deleteCourseType = (type_id, pass_word) => fetch('POST', '/weapp/delType', {
    type_id,
    pass_word
});

/**
 * 课程内容管理
 * by Jehu
*/
// 获取课程目录列表
export const obtainCourseCatalogList = (type_id, page) => fetch('POST', '/weapp/getCatalog', {
    type_id,
    page
});
// 添加课程阶段
export const appendCourseStage = (type_id, stage_cover) => fetch('POST', '/weapp/addStage', {
    type_id,
    stage_cover,
});
// 编辑课程阶段
export const compileCourseStage = (stage_id, stage_number, type_id, stage_cover) => fetch('POST', '/weapp/editStage', {
    stage_id, 
    stage_number, 
    type_id, 
    stage_cover
});
// 获取课程单节
export const obtainCourseSection = (section_id) => fetch('POST', '/weapp/getSection', {
    section_id
});
// 添加课程单节
export const appendCourseSection = (stage_id, type_id, section_number, section_day, section_name, section_target, section_kernel, section_job, section_cover, section_share, section_accompany, section_score, section_content) => fetch('POST', '/weapp/addSection', {
    stage_id,
    type_id,
    section_number,
    section_day,
    section_name,
    section_target, 
    section_kernel, 
    section_job,
    section_cover,
    section_share,
    section_accompany,
    section_score,
    section_content
});
// 编辑课程单节
export const compileCourseSection = (section_id, stage_id, type_id, section_number, section_day, section_name, section_target, section_kernel, section_job, section_cover, section_share, section_accompany, section_score, section_content) => fetch('POST', '/weapp/editSection', {
    section_id,
    stage_id,
    type_id,
    section_number,
    section_day,
    section_name,
    section_target, 
    section_kernel, 
    section_job,
    section_cover,
    section_share,
    section_accompany,
    section_score,
    section_content
});
// 删除课程单节
export const deleteCourseSection = (section_id, pass_word) => fetch('POST', '/weapp/delSection', {
    section_id,
    pass_word
});
// 获取游戏关卡列表
export const obtainGameScreeningList = (chapter_type) => fetch('POST', '/weapp/getScreening', {
    chapter_type
});
// 编辑小课堂
export const compileCourseLesson = (section_id, section_lesson) => fetch('POST', '/weapp/editLesson', {
    section_id, 
    section_lesson
});
/**
 * 免费体验课管理
 * by Jehu
*/
// 获取免费体验课列表数据
export const obtainWorkshopData = (page) => fetch('POST', '/weapp/acquireWorkshop', {
    page
});
// 获取免费体验课列表数据
export const obtainDiscountCouponData = () => fetch('POST', '/weapp/acquireDiscountCoupon', {});
// 添加免费体验课数据
export const accretionWorkshop = (gratis_name, gratis_coupon) => fetch('POST', '/weapp/appendWorkshop', {
    gratis_name,
    gratis_coupon
});
// 编辑免费体验课数据
export const compileWorkshop = (gratis_id, gratis_name, gratis_coupon) => fetch('POST', '/weapp/redactWorkshop', {
    gratis_id, gratis_name, gratis_coupon
}) 
// 删除免费体验课数据
export const removeWorkshop = (gratis_id, pass_word) => fetch('POST', '/weapp/deleteWorkshop', {
    gratis_id, pass_word
})
// 获取免费体验课详情数据
export const  obtainExperienceClassData = (gratis_id) => fetch('POST', '/weapp/acquireExperienceClass', {
    gratis_id
})
// 添加模块成员数据
export const accretionModuleMembers = ( gratis_id, module_title, module_depict, module_remark, module_rank, module_content ) => fetch('POST', '/weapp/appendModuleMembers', {
    gratis_id, module_title, module_depict, module_remark, module_rank, module_content
});
// 编辑模块成员数据
export const compileModuleMembers = ( module_id, gratis_id, module_title, module_depict, module_remark, module_rank, module_content ) => fetch('POST', '/weapp/redactModuleMembers', {
    module_id, gratis_id, module_title, module_depict, module_remark, module_rank, module_content 
});  
// 删除免费体验课数据
export const removeModuleMembers = (gratis_id, module_id, pass_word) => fetch('POST', '/weapp/deleteModuleMembers', {
    gratis_id, module_id, pass_word
}) 
/**
 * 课程意志计划
 * by Jehu
*/
// 获取 意志计划数据
export const obtainVolitionProject = () => fetch('get', '/weapp/willPlan/show',{});
// 更新 意志计划数据
export const updateVolitionProject = (entrance_image, entrance_app_image, introduce_image, introduce_app_image) => fetch('POST', '/weapp/willPlan/edit', {
    entrance_image,
    entrance_app_image, 
    introduce_image,
    introduce_app_image
});
/**
 * 课程打卡分享
 * by Jehu
*/
// 获取 打卡分享数据
export const obtainClockSharing = () => fetch('POST', '/weapp/getClock',{});
// 更新 打卡分享数据
export const updateClockSharing  = (wx_image_list, app_image_list) => fetch('POST', '/weapp/editClock', {
    wx_image_list, 
    app_image_list
});
/**
 * 社区管理
 * by Jehu
*/
// 置顶 集合中的记录
export const stickRecordFromGather = (matter_id, matter_stick) => fetch('POST', '/weapp/stickRecord', {
    matter_id, matter_stick
})
// 采纳 集合中的记录
export const adoptRecordFromGather = (matter_id, matter_adopt) => fetch('POST', '/weapp/adoptRecord', {
    matter_id, matter_adopt
})
// 推荐 集合中的记录
export const recommendRecordFromGather = (matter_id, matter_recommend) => fetch('POST', '/weapp/recommendRecord', {
    matter_id, matter_recommend
})
// 删除 集合中的记录
export const removeRecordFromGather = (forum_id) => fetch('POST', '/weapp/removeRecord', {
    forum_id
})
// 获取 用户信息
export const acquireUserMessage = () => fetch('GET', '/weapp/acquireUser', {})

// 获取 集合中的投票记录
export const acquireVoteFromGather = (page, size, text) => fetch('POST', '/weapp/acquireVote', {
    page, size, text
})
// 新增 投票记录到集合
export const appendVoteToGather  = (dynamicStateFrom) => fetch('POST', '/weapp/appendVote', {
    dynamicStateFrom
});
// 查看 集合中的投票记录
export const examineVoteFromGather = (matter_id) => fetch('POST', '/weapp/examineVote', {
    matter_id
})

// 获取 集合中的推荐记录
export const acquireRecommendFromGather = (page, size, text) => fetch('POST', '/weapp/acquireRecommend', {
    page, size, text
})
 
// 获取 集合中的归纳记录
export const acquireAdoptFromGather = (type, page, size, text, date) => fetch('POST', '/weapp/acquireAdopt', {
    type, page, size, text, date
})

// 获取 集合中的动态记录
export const acquireDynamicFromGather = (type, page, size, text, date) => fetch('POST', '/weapp/acquireDynamic', {
    type, page, size, text, date
})
// 查看 集合中的动态记录
export const examineDynamicFromGather = (matter_id) => fetch('POST', '/weapp/examineDynamic', {
    matter_id
})
/**
 * 活动管理
 * by Jehu
*/
// 获取 活动信息
export const acquireActivityInformation = (matterType) => fetch('POST', '/weapp/acquireBaseInformation', {
    matterType
})
// 更新 活动信息
export const renewalActivityInformation = (matterType, matterCover, matterReferral, matterRule, matterGain) => fetch('POST', '/weapp/renewalBaseInformation', {
   matterType, matterCover, matterReferral, matterRule, matterGain
})
// 更新 活动时间
export const renewalActivityTime = (matterStart, matterEnd, matterType) => fetch('POST', '/weapp/renewalBaseInformation', {
    matterStart, matterEnd, matterType
})
// 获取 参与数据
export const acquireParticipateDatum = (matterType) => fetch('POST', '/weapp/acquireParticipateDatum', {
    matterType
})
// 获取 乐曲资源
export const acquireLevelResource = (matterType) => fetch('POST', '/weapp/acquireMusicResource', {
    matterType
})
// 更新 乐曲资源
export const renewalLevelResource = (id, title, noteId, stripId, issueTime) => fetch('POST', '/weapp/renewalMusicResource', {
    id, title, noteId, stripId, issueTime
})

// 获取 乐曲关卡
export const acquireMusicLevel = (chapterType) => fetch('POST', '/weapp/acquireMusicLevel', {
    chapterType
})


/**
 * 课程介绍
 * by 雄
 */
/*  课程介绍页*/
// 首页
export const obtainIndexInfo = () => fetch('get', '/weapp/indexInfo/show',{});
// 课程介绍页 修改
export const updateIndexInfo = (bannerImg,courseImg) => fetch('POST', '/weapp/indexInfo/edit', {
    bannerImg,
    courseImg
});
/*常见问题*/
//  常见问题 获取
export const obtainQuestionsList = (page,type) => fetch('POST', '/weapp/question/show', {
    page,
    type
});
// 常见问题 添加
export const appendQuestions = (data,type) => fetch('POST', '/weapp/question/add', {
    question: data.question ,
    answer: data.answer ,
    imgs: String(data.imgs),
    type
});

// 常见问题 删除
export const delQuestions = (id) => fetch('POST', '/weapp/question/del', {
    id
});
// 常见问题 编辑
export const editQuestions = (data) => fetch('POST', '/weapp/question/edit', data);

/* 课程批次管理 */
// 课程批次 获取
export const obtainCourseBatchList = (page) => fetch('POST', '/weapp/courseBatch/get', {
    page
});
// 课程批次 修改报名最大人数
export const editCourseBatchMaxSum = (batch_id,num) => fetch('POST', '/weapp/courseBatch/editMaxSum', {
    batch_id,
    num
});
// 课程批次 删除批次
export const delCourseBatch = (batch_id,pass_word,username) => fetch('POST', '/weapp/courseBatch/delBatch', {
    batch_id,
    pass_word,
    username
});
// 课程批次 增加批次
export const appendCourseBatch = (data) => fetch('POST', '/weapp/courseBatch/addBatch', {
    batch_type: data.batch_type.type_name,
    start_time: data.start_time,
    end_time: data.end_time, 
    max_sum: data.max_sum,
    teacher_data: data.teacher_data,
    type_id: data.batch_type.type_id,
    batch_image: data.batch_image,
    teacher_name: data.teacher_name,
    gold_num: data.gold_num,
    silver_num: data.silver_num,
    gift_img: data.gift_img,
    coupon_img: data.coupon_img,
    gold_desc: data.gold_desc,
    silver_desc: data.silver_desc,
    teacher_icon: data.teacher_icon,
    cake_id: data.cake_id
});
// 课程批次 编辑批次
export const editCourseBatch = (data) => fetch('POST', '/weapp/courseBatch/editBatch', {
    batch_id:data.batch_id,
    max_sum:data.max_sum,
    teacher_data: data.teacher_data,
    batch_image: data.batch_image,
    teacher_name: data.teacher_name,
    gold_num: data.gold_num,
    silver_num: data.silver_num,
    gift_img: data.gift_img,
    coupon_img: data.coupon_img,
    gold_desc: data.gold_desc,
    silver_desc: data.silver_desc,
    teacher_icon: data.teacher_icon,
    cake_id: data.cake_id
});
//  获取课程类型
export const obtainCourseBatchTypeList = () => fetch('get', '/weapp/courseBatch/obtainCourseType');
// 获取小程序授权用户
export const obtainAccreditWxUser = (name, page) => fetch('post', '/weapp/courseBatch/obtainWxUser',{
    name,
    page
});
// 获取小程序授权用户
export const checkStudentBatch = (batch_id, union_id) => fetch('post', '/weapp/courseBatch/checkStudentBatch',{
    batch_id, 
    union_id
});


/**
 * 学员批次
 * by 雄
 */
// 学员批次 获取
export const obtainStudentBatchList = (page) => fetch('POST', '/weapp/studentBatch/get', {
    page
});
// 获取学员列表
export const obtainStudentDetailsList = (page,batch_id) => fetch('POST', '/weapp/studentBatch/studentList', {
    page,
    batch_id
});
// 设置学员禁言
export const setStudentShutup = (student_id) => fetch('POST', '/weapp/studentBatch/setStudentShutup', {
    student_id
});
// 学员 开除
export const studentExpel = (student_id) => fetch('POST', '/weapp/studentBatch/studentExpel', {
    student_id
});
// 学员 搜索
export const studentSearch = (batch_id,name,page) => fetch('POST', '/weapp/studentBatch/search', {
    batch_id,
    name,
    page
});
// 设置超级用户
export const studentSetSuper = (student_id,flag) => fetch('POST', '/weapp/studentBatch/setSuper', {
    student_id,
    flag
})


/**
 * 作业管理
 * by 雄
 */
/*  学员作业管理 */
//  获取作业
export const obtainJobList = (page,batch_id) => fetch('POST', '/weapp/jobDetails/get', {
    page,
    batch_id
});
// 删除作业
export const delJobDetails = (job_id) => fetch ('POST','/weapp/jobDetails/del',{
    job_id
}) 
// 设置为精选作业
export const setJobRecommend = (job_id) => fetch ('POST','/weapp/jobDetails/setRecommend',{
    job_id
}) 
// 设置为精选作业
export const cancelJobRecommend = (job_id) => fetch ('POST','/weapp/jobDetails/cancelRecommend',{
    job_id
}) 
// 更新作业评价
export const updateJobComment = (job_id,teach,teacher_id) => fetch ('POST','/weapp/jobDetails/updateJobComment',{
    job_id,
    teach,
    teacher_id
}) 
// 获取批次下的教师
export const obtainTeachList = (batch_id) => fetch ('POST','/weapp/jobDetails/teachList',{
    batch_id
}) 
// 搜索作业
export const obtainSearchJobList = (batch_id,name,page) => fetch ('POST','/weapp/jobDetails/searchJob',{
    batch_id,
    name,
    page
}) 
// 获取学员该批次下的所有作业
export const obtainAllJob = (student_id) => fetch ('POST','/weapp/jobDetails/obtainAllJob',{
    student_id,
}) 
// // 更新作业批改状态 作废。 现在以老师点评为已批改状态
// export const updateCorrect = (job_id,batch_id) => fetch ('POST','/weapp/jobDetails/updateCorrect',{
//     job_id,
//     batch_id
// }) 

/**
 * 评价管理
 * by 雄
 */
// 获取评论列表
export const obtainCommentList = (page) => fetch('POST', '/weapp/comment/get', {
    page
});
// 删除评论
export const delComment = (comment_id) => fetch('POST', '/weapp/comment/del', {
    comment_id
});


/**
 * 登录 
 * by 雄
*/
export const loginVerify = (username,password) => fetch('POST', '/weapp/loginVerify', {
    username,
    password
});

export const loginSession = () => fetch('get', '/weapp/loginSession', {});


/**
 * 邀请码 
 * by 雄
*/
// 邀请码列表
export const obtainInvitationCodeList = (page) => fetch('POST', '/weapp/getCodeList',{
    page
});
// 获取邀请码
export const obtainInvitationCode = () => fetch('get', '/weapp/createCode');

// 保存邀请码
export const saveInvitationCode = (code,phone,price) => fetch('POST', '/weapp/saveInvitationCode',{
    code,
    phone,
    price
});
// 保存邀请码
export const searchInvitationCode = (phone,page) => fetch('POST', '/weapp/searchInvitationCode',{
    phone,
    page
});
// 删除邀请码
export const delInvitationCode = (phone,invite_code) => fetch('POST', '/weapp/delInvitationCode',{
    phone,
    invite_code
});


/**
 * 订单管理 
 * by 雄
*/
// 列表
export const obtainOrderList = (page) => fetch('POST', '/weapp/order/get',{
    page
});
// 根据手机号码搜索
export const obtainSearchOrder = (phone,page) => fetch('POST', '/weapp/order/searchPhone',{
    phone,
    page
});

// 根据手机号码搜索
export const obtainOrderExcel = (startTime,endTime) => fetch('POST', '/weapp/order/downOrderExcel',{
    startTime,
    endTime
});


/**
 * 订单管理 
 * by 雄
*/
// 发布 评论内容 数据
export const releaseCommmentContent = (job_id, from_id, back_comment) => fetch('POST', '/weapp/comment/add', {
    job_id, 
    from_id,
    back_comment
  })

/**
 * 发送邀请码 
 * by 雄
*/
// 发送邀请码
export const sendInvitationCode = (code, phone) => fetch('POST', '/weapp/sendInvitationCode', {
    code, 
    phone
})


/**
 * 打卡系统 
 * by 雄
*/
// 参与的课程列表
export const obtainCourseSectionList = (student_id) => fetch('POST', '/weapp/studentCourseSection/get', {
    student_id
})
//  学员补打卡
export const studenRepairClock = (student_id,batch_id,section_id,type) => fetch('POST', '/weapp/studenRepairClock', {
    student_id,
    batch_id,
    section_id,
    type
})

/**
 * 礼券 
 * by 雄
*/
// 获取礼盒的兑换数据
export const obtainGiftList = (page) => fetch('POST', '/weapp/giftManage/giftList', {
    page
})
// 获取礼盒的物流信息
export const obtainLogistics = (com,num) => fetch('POST', '/weapp/giftManage/Logistics', {
    com,num
})
// 修改礼盒的物流信息
export const uploadLogistics = (g_id,com,num,user_name,phone,address) => fetch('POST', '/weapp/giftManage/uploadLogistics', {
    g_id, com, num, user_name,phone,address
})
// 向用户推送物流单号
export const remindUserPush = (g_id) => fetch('POST', '/weapp/giftManage/remindUser', {
    g_id
})
// 搜索礼盒收货人
export const obtainUserSearch = (name,page) => fetch('POST', '/weapp/giftManage/userSearch', {
    name,page
})
// 获取优惠券类型
export const obtainCouponType = () => fetch('POST', '/weapp/obtainCouponType', {})
// 统一发送卡卷
export const giveUserCoupon = ( batch_id, student_id, type, cake_id, invalid_date, notification, remark ) => fetch('POST', '/weapp/giftManage/giveCoupon', {
    batch_id, 
    student_id, 
    type, 
    cake_id, 
    invalid_date, 
    notification,
    remark
})


/**
 * 引用小程序接口
 */
// 获取 用户是否已经报名改课程类型
export const obtainCheckCourseType = (type_id, union_id,batch_id) => fetch('POST', '/weapp/checkCourseType', {
    type_id,
    union_id,
    batch_id
},false,true)
// 获取 微信支付 配置参数
export const obtainWXPayParam = (openid, union_id, body, total_fee, gross_price, nickName, coupon_id, invite_code, type, type_id, batch_id) => fetch('POST', '/weapp/getWXPay', {
    openid,
    union_id,
    body,
    total_fee,
    gross_price,
    nickName,
    coupon_id,
    invite_code,
    type,
    type_id,
    batch_id
},false,true)
// 确定 课程订单 数据
export const amendCourseIndent = (order_id, amount, gross_price, nickName, invite_code, type, open_id, union_id, type_id, batch_id) => fetch('POST', '/weapp/updindent', {
    order_id,
    amount,
    gross_price,
    nickName,
    invite_code,
    type,
    open_id,
    union_id,
    type_id,
    batch_id
},false,true)
// 保存 用户信息
export const preserveUserinfo = (open_id, batch_id, student_id, union_id) => fetch('POST', '/weapp/keepUserinfo', {
    open_id, 
    batch_id, 
    student_id,
    union_id
},false,true)

/**
 * 敏感词
 * by 雄
 */
// 获取敏感类型
export const obtainSensitiveType = () => fetch('POST', '/weapp/obtainSensitiveType', {
})
// 添加敏感类型
export const addSensitiveType = (name) => fetch('POST', '/weapp/addSensitiveType', {
    name
})
// 删除敏感类型
export const deleteSensitiveType = (type) => fetch('POST', '/weapp/deleteSensitiveType', {
    type
})
// 获取敏感词列表
export const obtainSensitiveWord = (type, page) => fetch('POST', '/weapp/obtainSensitiveWord', {
    type, 
    page
})
// 添加敏感词列表
export const addSensitiveWord = (type, word) => fetch('POST', '/weapp/addSensitiveWord', {
    type, 
    word
})
// 添加敏感词列表
export const deleteSensitiveWord = (id) => fetch('POST', '/weapp/deleteSensitiveWord', {
    id
})
// 添加敏感词列表
export const checkSensitive = (text) => fetch('POST', '/weapp/checkSensitive', {
    text
})


/**
 * 请老师点评 （章节作业）
 * by 雄
 */

// 章节作业列表
export const obtainChapterJob = (page, name) => fetch('POST', '/weapp/jobDetails/obtainChapterJob', {
    page,
    name
})
/**
 * 举报
 * by 雄
 */

// 举报列表
export const obtainInformList = (page, rank, startTime, endTime) => fetch('POST', '/weapp/obtainInform', {
    page,
    rank,
    startTime,
    endTime
})
// 忽略举报
export const overlookInform = (id, informType) => fetch('POST', '/weapp/overlookInform', {
    id,
    informType
})
// 举报的用户
export const informUserDetails = (id, informType, page) => fetch('POST', '/weapp/informUserDetails', {
    id,
    informType,
    page
})
// 举报的用户
export const deleteInformPlace = (id, informType, describe) => fetch('POST', '/weapp/deleteInformPlace', {
    id,
    informType,
    describe
})


/**
 * 评论列表 3.0需求
 * by 雄
 */
// 获取评论列表
export const obtainComment = (forum_id, page) => fetch('POST', '/weapp/obtainComment', {
    forum_id,
    page
})
// 获取更多子评论
export const obtainMoreChildComment = (parentId, union_id, page) => fetch('POST', '/weapp/obtainMoreChildComment', {
    parentId, 
    union_id, 
    page
})

// 删除评论
export const deleteComment = (parentId, childId, describe) => fetch('POST', '/weapp/deleteComment', {
    parentId, 
    childId, 
    describe
})

/**
 *  暑假活动
 * by 雄
 */
// 设置阶段时间
export const setActivityStageTime = (matterType, matterStage) => fetch('POST', '/weapp/setActivityStageTime', {
    matterType, 
    matterStage
})
// 获取阶段时间
export const acquireActivityStageTime = (matterType) => fetch('POST', '/weapp/acquireActivityStageTime', {
    matterType
})
// 获取阶段获奖名单
export const acquireStageAwardUser = (page, matterStage, searchText, downAll) => fetch('POST', '/weapp/acquireStageAwardUser', {
    page,
    matterStage,
    searchText,
    downAll
})
// 获取奖励金分配名单
export const acquireAwardAssignMenu = (page, sort) => fetch('POST', '/weapp/acquireAwardAssignMenu', {
    page,
    sort
})
// 修改奖励金分配名单
export const updateUserAward = (userId, randomBonus) => fetch('POST', '/weapp/updateUserAward', {
    userId, 
    randomBonus
})
// 公发信息
export const auditJackpot = () => fetch('POST', '/weapp/auditJackpot', {
},false, false, true)

// 获取特别勤奋奖
export const acquireDiligentAwardMenu = (page, searchText, downAll) => fetch('POST', '/weapp/acquireDiligentAwardMenu', {
    page,
    searchText, 
    downAll
})

// 雄
// 大家说，发表评论
// 添加新的评论
export const appendCommentToGather = (commentStateFrom) => fetch('POST', '/weapp/appendComment', {
    commentStateFrom
}, false, true)